﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MessageShark;
using PServiceBus.Core.Interface;

namespace PServiceBus.Transports {
    public class SerializationBootstrapper {
        public static void Configure() {
            if (!MessageSharkSerializer.IsTypeRegisterFor<ITransport>(typeof(BasicHttpTransport)))
                MessageSharkSerializer.RegisterTypeFor<ITransport>(typeof(BasicHttpTransport), 1);
            if (!MessageSharkSerializer.IsTypeRegisterFor<ITransport>(typeof(FtpTransport)))
                MessageSharkSerializer.RegisterTypeFor<ITransport>(typeof(FtpTransport), 2);
            if (!MessageSharkSerializer.IsTypeRegisterFor<ITransport>(typeof(HttpTransport)))
                MessageSharkSerializer.RegisterTypeFor<ITransport>(typeof(HttpTransport), 3);
            if (!MessageSharkSerializer.IsTypeRegisterFor<ITransport>(typeof(MSMQTransport)))
                MessageSharkSerializer.RegisterTypeFor<ITransport>(typeof(MSMQTransport), 4);
            if (!MessageSharkSerializer.IsTypeRegisterFor<ITransport>(typeof(RabbitMQTransport)))
                MessageSharkSerializer.RegisterTypeFor<ITransport>(typeof(RabbitMQTransport), 5);
            if (!MessageSharkSerializer.IsTypeRegisterFor<ITransport>(typeof(RedisTransport)))
                MessageSharkSerializer.RegisterTypeFor<ITransport>(typeof(RedisTransport), 6);
            if (!MessageSharkSerializer.IsTypeRegisterFor<ITransport>(typeof(TcpTransport)))
                MessageSharkSerializer.RegisterTypeFor<ITransport>(typeof(TcpTransport), 7);
            if (!MessageSharkSerializer.IsTypeRegisterFor<ITransport>(typeof(WebServiceTransport)))
                MessageSharkSerializer.RegisterTypeFor<ITransport>(typeof(WebServiceTransport), 8);
        }
    }
}
